package com.dmm.user.service.impl;

import com.dmm.user.entity.Question;
import com.dmm.user.mapper.QuestionMapper;
import com.dmm.user.service.QuestionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author com/dmm
 * @since 2023-04-06
 */
@Service
public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> implements QuestionService {


    @Resource
    QuestionMapper questionMapper;

    //随机获取题目
    @Override
    public List<Question> getsubject(Integer degree) {

        if(degree==1){
            List<Question> list=questionMapper.getsubject1(10);
            return list;
        }else if(degree==2){
            List<Question> list=questionMapper.getsubject1(20);
            return list;
        }else{
            List<Question> list=questionMapper.getsubject1(30);
            return list;
        }

    }
}
